package com.mk.settlement.common;

import java.util.List;

/**
 * 分页对象
 * @author anan
 *
 */
public class Page {
    private int pageNo = 1; //页码，默认是第一页
    private int pageSize = 10; //每页显示的记录数，默认是10
    private int totalRecord = 0; //总记录数
    private int totalPage = 1; //总页数
	private String orderby = ""; //排序
	private int index;
	private List result;    //查询的结果集
	private int start;
	private String  beginTime;   //开始时间（查询用【年月日】）
	private String  endTime;     //结束时间（查询用【年月日】）
	private boolean  currentPage=true;  //导出用
	
	
    public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public int getTotalRecord() {
		return totalRecord;
	}

	public void setTotalRecord(int totalRecord) {
		this.totalRecord = totalRecord;

		totalPage = totalRecord%pageSize==0 ? totalRecord/pageSize : totalRecord/pageSize + 1;
	    this.setTotalPage(totalPage);
	}

	public int getTotalPage() {
		
		return totalPage;
	}

	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}

	public String getOrderby() {
		return orderby;
	}

	public void setOrderby(String orderby) {
		this.orderby = orderby;
	}

	public int getIndex() {
		return (this.getPageNo() - 1) * this.getPageSize();
	}

	public void setIndex(int index) {
		this.index = index;
	}

	public List getResult() {
		return result;
	}

	public void setResult(List result) {
		this.result = result;
	}

	public int getStart() {
		return  (pageNo-1)*pageSize;
	}

	public void setStart(int start) {
		this.start = start;
	}

	public String getBeginTime() {
		if(beginTime!=null && beginTime!="" ){
			return beginTime.trim()+" 00:00:00";
		}
		return null;
	}

	public void setBeginTime(String beginTime) {
		this.beginTime = beginTime;
	}

	public String getEndTime() {
		if(endTime!=null && endTime!="" ){
			return endTime.trim()+" 23:59:59";
		}
		return null;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public boolean getCurrentPage() {
		return currentPage;
	}

	public void setCurrentPage(boolean currentPage) {
		this.currentPage = currentPage;
	}
	
	
	
	
}
